import { Injectable } from '@angular/core';
import {Order} from "./entity/order";
import {Observable, of} from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class OrderDataService {

  private sysClass = ['01', '02', '03','04','05','06','07']
  constructor() { }

  getOrderList(): Observable<Order[]> {
    const result: Order[] = [];
    for (let i = 0; i < 600; i++) {
      const d = {
        ...data
      }
      d.sysClass = this.getSysClass(i)
      result.push(d)
    }
    return of(result)
  }

  private getSysClass(seed: number): string {
    return this.sysClass[seed % this.sysClass.length]
  }
}

const data: Order =
  {
    examType: null,
    pathState: null,
    pathUserId: null,
    userElementId: null,
    isFuzzyMatch: null,
    isMust: null,
    execDay: null,
    isOverStage: null,
    classifyNo: null,
    pcState: null,
    groupId: null,
    groupName: null,
    disuseFlag: false,
    outDatetime: null,
    outReasonCode: null,
    outReasonName: null,
    informedConsent: null,
    patientInfoPrompt: null,
    poeIpoGroupDetailId: null,
    totCost: null,
    clinicDiagnose: null,
    feeItemInfos: [],
    orderTypeCode: "CZ",
    orderTypeName: "长期医嘱",
    needConfirmFlag: null,
    testOrderSN: null,
    antibioticLevel: null,
    antibioticApproveName: null,
    feeCode: "01",
    approveState: null,
    approveNote: null,
    unqualifiedReason: null,
    description: null,
    examineDate: null,
    curModcDatetime: "",
    nxtModcDatetime: "",
    dcDatetime: "",
    dcOperCode: null,
    dcOperName: null,
    moNote: null,
    inPatientSN: "000005202206301",
    inPatientNO: "000005",
    beginDateTime: "2022-06-30 11:33:14",
    endDateTime: "",
    firstAdds: "1",
    longFlag: "1",
    discribeFlag: "0",
    antibioticType: null,
    confirmNurseCode: null,
    confirmNurseName: null,
    confirmDateTime: "",
    dcClassCode: null,
    dcClassName: null,
    dcConfirmNurseCode: null,
    dcConfirmNurseName: null,
    dcConfirmDateTime: "",
    orderKind: "03",
    orderKindName: null,
    testOption: null,
    testOptionName: "",
    testDrugFlag: null,
    testClass: null,
    testDesc: null,
    herbalName: null,
    herbUsageCode: null,
    herbUsageName: null,
    patientId: "PN00000008",
    orderStateClass: "01",
    orderStateClassName: "开立",
    termExeDepts: [],
    drugStockBOList: [],
    labSampleName: null,
    siFlag: "乙",
    execSn: null,
    chargeBaseQty: null,
    unit: "02",
    packUnit: "盒",
    produceLocation: null,
    doseQty: null,
    catalyzerDrug: null,
    catalyzerDrugName: null,
    produceTypeCode: null,
    produceTypeName: null,
    entryDeptCode: "102",
    entryDeptName: "内二科",
    appClass: null,
    appClassName: null,
    emcFlag: null,
    tradeClass: null,
    partMajorCode: null,
    partMinorCode: null,
    examMethodCode: null,
    examMethodName: null,
    combNO: "IC202206300000000118",
    combSeqNO: "1",
    tradeName: "拜瑞妥",
    sortNo: 1,
    entryOperCode: "ys01",
    entryOperName: "医生管理员",
    hospitalId: "420648727",
    compoundId: "001",
    transType: null,
    drugFlag: null,
    bookState: null,
    bookStateName: null,
    bookSource: null,
    sysClass: "01",
    termTypeName: null,
    spellCode: null,
    wbCode: null,
    customCode: null,
    termName: "利伐沙班片",
    termCode: "ZYX000290",
    specs: "10mg*5s",
    doseModelCode: "01",
    doseModelName: "片剂",
    doseModelRellCode: null,
    doseModelRellName: null,
    remark: null,
    execDeptCode: "10201",
    execDeptName: "内二科病区",
    execDeptList: [],
    storeDeptCode: "20102",
    storeDeptName: "住院西药房",
    storeDeptList: [],
    frequencyCode: "BID",
    frequencyName: "一天2次",
    chargeQty: null,
    onceDose: 10,
    doseUnit: "mg",
    onceDoseUnit: "mg",
    termUnit: "盒",
    baseDose: 10,
    baseUnit: "片",
    packQty: 5,
    drugType: "1",
    unitPrice: 96.6,
    testClassName: "",
    usageCode: "1",
    usageName: "口服",
    examPart: null,
    examPartName: null,
    itemPartSmall: null,
    labSample: null,
    labSamples: null,
    pharmacy: null,
    specialProperty: "N",
    specialPropertyName: null,
    specialPropertyClass: null,
    attention: null,
    entryDatetime: "2022-06-30 11:35:53",
    orderSn: "IO202206300000000412",
    limitLiquidSpeed: null,
    limitLiquidSpeedMax: null,
    limitLiquidUnit: null,
    limitLiquidUnitCode: null,
    onceDoseClass: "02",
    backupBaseUnit: null,
    producerName: null,
    tradeSpellCode: null,
    tradeWbCode: null,
    tradeCustomCode: null,
    cadnSpellCode: null,
    cadnWbCode: null,
    cadnCustomCode: null,
    cadnName: null,
    englishName: null,
    stockDeptCode: null,
    useTip: null,
    limitClass: null,
    testFlag: "0",
    unitClass: null,
    usageQtyCode: null,
    usageQtyName: null,
    produceQtyCode: null,
    produceQtyName: null,
    oftenUsageDose: null,
    oftenUsageUnit: null,
    orderClass: "01",
    orderClassName: null,
    extend1: null,
    extend2: null,
    extend3: null,
    mainDrugFlag: null,
    useDays: null,
    inpatientName: null,
    testing: null,
    execType: "02",
    nurseGradeCode: null,
    urgentFlag: null,
    termDisplayName: "拜瑞妥",
    indication: null,
    specimen: null,
    contraindication: null,
    inspectPurpose: null,
    testPurpose: null,
    termAttention: null,
    termRemarks: null,
    reviewPrescriptionResultCode: null,
    reviewPrescriptionResultName: null,
    reviewPrescriptionResultOrderSn: null,
    reviewPrescriptionResultComboNo: null,
    reviewPrescriptionResultStatus: null,
    sexLimit: null,
    nationSiCode: "XB01AFL056A001010100002",
    areaSiCode: null,
    hrpBatchNo: null,
    stockQty: null,
    nationSiName: null,
    stockDeptName: null,
    withholdQty: null,
    availableQty: null,
    referenceCost: null,
    unitPriceDisCodes: null,
    tubeTypeCode: null,
    messageKey: null,
    entryOperNameImg: null,
    confirmNurseNameImg: null,
    varianceFlag: null,
    parentCombNo: null,
    cancelReason: null,
    frequencyTime: null,
    stockNum: null,
    injectDatetime: null,
    operator: null,
    isSingal: null,
    treatMethod: null,
    testAddRemark: null,
    returnReason: null
  }
